/*
* yasl-qt (or simply yasl) is a qt-based program for symbian devices
* and intended to manage a shopping list.
* The acronym yasl stands for Yet Another Shopping List.
* 
* Copyright (C) 2011 - Alessandro Orlandi
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef SHOPPINGLIST_H
#define SHOPPINGLIST_H

#include <QListWidget>
#include <QDir>
#include <QFile>
#include <QTextStream>

class ShoppingList : public QListWidget
{
    Q_OBJECT
public:
    explicit ShoppingList(QWidget *parent = 0);
    ~ShoppingList();

signals:
    void sigItemTaken(QString);
    void sigItemRemoved(QString);
    void sigItemDropped(QString);
    void sigListPurged(QStringList);

public slots:
    void addNewItem(QString);
    void removeSelectedItem();
    void takeSelectedItem();
    void saveShoppingList();
    void dropSelectedItem();
    void removeItemByName(QString);
    void setShowOption(int);
    void refreshListView(QString item="");
    void purgeShoppingList();


protected:
  int mShowOption; //0 = ALL, 1 = MISSING, 2 = TAKEN
  bool loadShoppingListFromFile();

};

#endif // SHOPPINGLIST_H
